using Game.Networking.Client;
using Game.Networking.Events;
using MemoryPack;
using SMGCore.EventSys;

namespace Game.Networking {
	public class S_LoadFinalizeMessageHandler : BaseServerMessageHandler {

		public override ServerPacketID CommandId {
			get {
				return ServerPacketID.LoadFinalize;
			}
		}

		public override void ProcessMessage(byte[] rawCommand) {
			var command = MemoryPackSerializer.Deserialize<S_LoadFinalizeMessage>(rawCommand);
			ClientController.Instance.SendNetMessage(ClientPacketID.LoadFinalizeConfirmed, new C_LoadFinalizeConfirmedMessage());
			EventManager.Fire(new OnConnectedToServer());
		}
	}
}
